package com.example.demo.service.impl;

import com.example.demo.dao.BackgrounduserDao;
import com.example.demo.pojo.Backgrounduser;
import com.example.demo.pojo.Warehouse;
import com.example.demo.service.BackgrounduserService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BackgrounduserServiceImpl implements BackgrounduserService {

    @Autowired
    private BackgrounduserDao backgrounduserDao;
    @Override
    public int deleteByPrimaryKey(Integer backgrounduserid) {
        return backgrounduserDao.deleteByPrimaryKey(backgrounduserid);
    }

    @Override
    public int insert(Backgrounduser record) {
        return backgrounduserDao.insert(record);
    }

    @Override
    public int insertSelective(Backgrounduser record) {
        return backgrounduserDao.insertSelective(record);
    }

    @Override
    public Backgrounduser selectByPrimaryKey(Integer backgrounduserid) {
        return backgrounduserDao.selectByPrimaryKey(backgrounduserid);
    }

    @Override
    public Backgrounduser selectByName(String accountNumber) {
        return backgrounduserDao.selectByName(accountNumber);
    }


    @Override
    public int updateByPrimaryKeySelective(Backgrounduser record) {
        return backgrounduserDao.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Backgrounduser record) {
        return backgrounduserDao.updateByPrimaryKey(record);
    }

    //查询所有后台用户
    @Override
    public List<Backgrounduser> selectBackgrounduser() {
        return backgrounduserDao.selectBackgroundUser();
    }

    //分页查询
    @Override
    public Page<Backgrounduser> select(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return backgrounduserDao.select();
    }

    //根据账号查询
    @Override
    public Backgrounduser selectByaccountNumber(String accountNumber) {
        return backgrounduserDao.selectByaccountNumber(accountNumber);
    }
}
